package ai.people.netmon.framework.domain.telegram.entity;

import ai.people.netmon.framework.typehandler.MyLocalDateTimeTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author xing.wei
 * @since 2022-01-06 17:07:14
 */
@TableName(value = "messages", schema = "telegram", autoResultMap = true)
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = false)
public class Messages implements Serializable {

    private static final long serialVersionUID = 1L;


    @TableField(value = "id")
    private Long id;


    @TableField(value = "message")
    private String message;


    @TableField(value = "reply_to_msg_id")
    private Long replyToMsgId;


    @TableField(value = "sender_id")
    private Long senderId;


    @TableField(value = "chat_id")
    private Long chatId;

    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @TableField(value = "date", typeHandler = MyLocalDateTimeTypeHandler.class)
    private LocalDateTime date;

    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @TableField(value = "ts", typeHandler = MyLocalDateTimeTypeHandler.class)
    private LocalDateTime ts;


    @TableField(value = "self_id")
    private Long selfId;


    @TableField(value = "self_no")
    private String selfNo;

}